UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '49sMNVqWrSD55OVV4k/N29gOPtnjIiFNQ94WklZCPXk=' 
WHERE 
  key_id = '1e24df418ef1c1257c34a8f047255add4e775fdc5414fc5371dd1f99978ec535' 
  AND (
    token = '49sMNVqWrSD55OVV4k/N29gOPtnjIiFNQ94WklZCPXk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023