UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Bbk++FB8JSEmiUerkhohZguXB60erhrtRpcK3DSx900=' 
WHERE 
  key_id = '56c7b4d03dbae4e4bf4d9552f3ea354d49ecd6eaf8bef48cf05527f8a45c33ee' 
  AND (
    token = 'Bbk++FB8JSEmiUerkhohZguXB60erhrtRpcK3DSx900=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040