UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xrNO5j+VgnVQGgjP2DDItOPcfZcBMDgak996hkK9aqM=' 
WHERE 
  key_id = '70235b8b25b8f0e642d158d8e39dfc24343bfc6cd1ddaabb8a2d480dbf19295a' 
  AND (
    token = 'xrNO5j+VgnVQGgjP2DDItOPcfZcBMDgak996hkK9aqM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026