UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5st+EWBYuzf5QNhe8wLeqvqW1928vjWDdLIrB+d7DIg=' 
WHERE 
  key_id = '55a9e206ca821c0283cdfd357fadb212f051bb5625a9ef18f6639697836ae2de' 
  AND (
    token = '5st+EWBYuzf5QNhe8wLeqvqW1928vjWDdLIrB+d7DIg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024