UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DxY2A7wRwQZ7VN1ZYvQhza5CAyvtReaY8DcDrPldMYA=' 
WHERE 
  key_id = 'eebaaafa4ece2e4bf59a6ceab1a717e0e050c1329be395617bafee5740fe5abc' 
  AND (
    token = 'DxY2A7wRwQZ7VN1ZYvQhza5CAyvtReaY8DcDrPldMYA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055