UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/k5zB9lefxz2H1Ji5E389xh/3ssXv+tRlcm6QqZ4SU8=' 
WHERE 
  key_id = '24979de27e236c3460732cb80d5d51354057cf2a7066d6f63337f9090cf01592' 
  AND (
    token = '/k5zB9lefxz2H1Ji5E389xh/3ssXv+tRlcm6QqZ4SU8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036