UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EoSDudzIk/I57HdtpX2+7dYgEFZzmrrTSKY7lPKdBXo=' 
WHERE 
  key_id = '455feaec59b6c6de12f25bcb5821ed1649bf7b34a6a6fcf30daba6a2dd005441' 
  AND (
    token = 'EoSDudzIk/I57HdtpX2+7dYgEFZzmrrTSKY7lPKdBXo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028