UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jsXI/9Xqj94OhDW8trbgcj0U5rpmIoFO2PcN2lg7kvI=' 
WHERE 
  key_id = 'd233d240dd8e0b95e2d4528dd1d9bebd0ac92b941dc33d5fa0eba7b300b47f01' 
  AND (
    token = 'jsXI/9Xqj94OhDW8trbgcj0U5rpmIoFO2PcN2lg7kvI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035