UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0fVoppjq2YKwgZ8D3vXAqyv8D05vmqvv+jqU1FGM/h8=' 
WHERE 
  key_id = '19e994e9fe916df290dcd85b1f6bb05520bdb9f6c29798ceb70e787a2c4a209d' 
  AND (
    token = '0fVoppjq2YKwgZ8D3vXAqyv8D05vmqvv+jqU1FGM/h8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031