UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DASRtAFSAqSyPc0lPzn2zvRM6Es/ljvGIp4mhrZ95J8=' 
WHERE 
  key_id = 'a4329ed5083ddd1e1d38a065ae179eb75eb324a1135697c459d5ad0fdc6a5545' 
  AND (
    token = 'DASRtAFSAqSyPc0lPzn2zvRM6Es/ljvGIp4mhrZ95J8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039