UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gtugfJqKzuReIyFfUBX8IGqcDiQIGZYGHBRZH2BfvSc=' 
WHERE 
  key_id = '19d647eb553c5f676a71ddfda289c538ce45ad87a658c1f9b138a20aa3656ab0' 
  AND (
    token = 'gtugfJqKzuReIyFfUBX8IGqcDiQIGZYGHBRZH2BfvSc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026