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

Query time 0.00037