UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'epTQb203mnDN9qVNRYWd0sKMqLrGX+k21paf3DqBXsY=' 
WHERE 
  key_id = '011e45be6a0ee5c6f238c3323f2d289d6d21db14eed6be6c6ca16ced219a5e96' 
  AND (
    token = 'epTQb203mnDN9qVNRYWd0sKMqLrGX+k21paf3DqBXsY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040