UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4pJOePqb+aVNJSjsagJtl8dUJ9/Y69vXwH4Ax0HujR4=' 
WHERE 
  key_id = '6823f936d8fa75efa7f1a7f6e3e97538999cc3b77694fe22728f600b2f6ddb76' 
  AND (
    token = '4pJOePqb+aVNJSjsagJtl8dUJ9/Y69vXwH4Ax0HujR4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025